home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 8: LINUX Games / Linux Cubed Series 8 - LINUX Games.iso / games / torus-sr.tar / torus-sr / torus / makefile < prev    next >
Makefile  |  1992-03-06  |  6KB  |  198 lines

  1. # Makefile written by Paul Pomes, University of Illinois,
  2. # Computing Services Office
  3. #
  4. # Copyright (C) 1986 by Paul Pomes and the University of Illinois Board
  5. # of Trustees
  6. #
  7. # This Makefile is distributed in the hope that it will be useful,
  8. # but without any warranty.  No author or distributor accepts
  9. # responsibility to anyone for the consequences of using it or for
  10. # whether it serves any particular purpose or works at all, unless
  11. # s/he says so in writing.
  12. #
  13. # Everyone is granted permission to copy, modify and redistribute
  14. # this Makefile under the following conditions:
  15. #
  16. #    Permission is granted to anyone to make or distribute copies
  17. #    of Makefile source code, either as received or modified, in any
  18. #    medium, provided that all copyright notices, permission and
  19. #    nonwarranty notices are preserved, and that the distributor
  20. #    grants the recipient permission for further redistribution as
  21. #    permitted by this document, and gives him and points out to
  22. #    him an exact copy of this document to inform him of his rights.
  23. #
  24. #    Permission is granted to distribute this Makefile in compiled
  25. #    or executable form under the same conditions applying for
  26. #    source code, provided that either
  27. #    A. it is accompanied by the corresponding machine-readable
  28. #       source code, or
  29. #    B. it is accompanied by a written offer, with no time limit,
  30. #       to give anyone a machine-readable copy of the corresponding
  31. #       source code in return for reimbursement of the cost of
  32. #       distribution.  This written offer must permit verbatim
  33. #       duplication by anyone.
  34. #    C. it is distributed by someone who received only the
  35. #       executable form, and is accompanied by a copy of the
  36. #       written offer of source code which he received along with it.
  37. #
  38. # In other words, you are welcome to use, share and improve this
  39. # Makefile.  You are forbidden to forbid anyone else to use, share
  40. # and improve what you give them.   Help stamp out software-hoarding!
  41. #
  42. # UUCP:     {ihnp4,seismo}!uiucuxc!paul
  43. # Internet: paul@uxc.cso.uiuc.edu   BITNET: paul@uiucuxc
  44. # MILNET:   paul@uiucuxc.arpa       CSNET:  paul%uxc@uiuc.csnet
  45. # US Mail:  Univ of Illinois, CSO, 1304 W Springfield Ave, Urbana, IL  61801
  46.  
  47. # .PREFIXES:    ./RCS
  48. .SUFFIXES:    .c,v .h,v .y,v
  49.  
  50. CC     = gcc
  51. CO     = co
  52. RM     = /bin/rm -f
  53.  
  54. HOF_FILE= ${DESTLIB}/robots2_hof
  55. TMP_FILE= ${DESTLIB}/robots2_tmp
  56. T_HOF_FILE= ${DESTLIB}/torus_hof
  57. T_TMP_FILE= ${DESTLIB}/torus_tmp
  58.  
  59. # -DBSD42 provides big performance win, but not for Linux!
  60.  
  61. #DEFS   = -DBSD42 -DHOF_FILE='"${HOF_FILE}"' -DTMP_FILE='"${TMP_FILE}"' -DT_HOF_FILE='"${T_HOF_FILE}"' -DT_TMP_FILE='"${T_TMP_FILE}"'
  62. DEFS   =  -DHOF_FILE='"${HOF_FILE}"' -DTMP_FILE='"${TMP_FILE}"' -DT_HOF_FILE='"${T_HOF_FILE}"' -DT_TMP_FILE='"${T_TMP_FILE}"'
  63. CFLAGS = ${DEFS} -O
  64. FFLAGS = ${DEFS}
  65. PFLAGS = ${DEFS}
  66. LFLAGS = 
  67. YFLAGS = 
  68. LDFLAGS= 
  69. LIBS   = -lcurses -ltermcap
  70.  
  71. DESTBIN= /usr/games
  72. DESTETC= /usr/games/etc
  73. DESTLIB= /usr/games/lib
  74. MS     = l
  75.  
  76.  
  77. HDRS   = robots.h
  78. SRCS   = good.c main.c opt.c robot.c score.c user.c
  79. OBJS   = good.o main.o opt.o robot.o score.o user.o
  80. VERS   = 
  81.  
  82. .c,v.o:
  83.     ${CO} -q $*.c
  84.     ${CC} ${CFLAGS} -c $*.c
  85.     ${RM} $*.c
  86.  
  87. .c,v.c:
  88.     ${CO} -q $*.c
  89.  
  90. .h,v.h:
  91.     ${CO} -q $*.h
  92.  
  93. .y,v.y:
  94.     ${CO} -q $*.y
  95.  
  96. all:    torus
  97.  
  98. torus:  ${OBJS}
  99.     ${CC} -o torus ${LDFLAGS} ${OBJS} ${LIBS}
  100.  
  101. install:    torus
  102.     install -s -m 2511 -g games torus ${DESTBIN}
  103.     touch ${HOF_FILE} ${TMP_FILE}
  104.     chmod 664 ${HOF_FILE} ${TMP_FILE}
  105.     chgrp games ${HOF_FILE} ${TMP_FILE}
  106.     touch ${T_HOF_FILE} ${T_TMP_FILE}
  107.     chmod 664 ${T_HOF_FILE} ${T_TMP_FILE}
  108.     chgrp games ${T_HOF_FILE} ${T_TMP_FILE}
  109.     install -c -m 444 torus.6 ${MANDIR}/torus.${MS}
  110.  
  111. uninstall:    /tmp
  112.     rm -f ${DESTBIN}/torus \
  113.         ${MANDIR}/torus.${MS} ${CATDIR}/torus.${MS} \
  114.         ${HOF_FILE} ${TMP_FILE}
  115.  
  116. lint:    ${HDRS} ${SRCS}
  117.     lint -habx ${DEFS} ${SRCS}
  118.  
  119. shar:    ${HDRS} ${SRCS} ${OTHERS}
  120.     shar ${HDRS} ${SRCS} ${OTHERS} > torus.shar
  121.  
  122. tags:    ${HDRS} ${SRCS}
  123.     ctags ${HDRS} ${SRCS}
  124.  
  125. clean:
  126.     @echo "Removing object and junk files."
  127.     rm -f robots2 *.o core a.out make.log lint.out Makefile.bak torus.shar
  128.  
  129. clobber:
  130.     @echo "Removing read-only source files that have RCS parents."
  131.     @echo "Error code 1 indicates last file in SRCS list was not removed."
  132.     @echo "(Which is OK)"
  133.     make clean
  134.     -if [ `whoami` != root ]; then \
  135.        for i in ${HDRS} ${SRCS}; do \
  136.           if [ ! -w $$i ]; then \
  137.              ( if   [ -f $$i,v ];     then rm -f $$i; \
  138.                elif [ -f RCS/$$i,v ]; then rm -f $$i; \
  139.              fi ); \
  140.           else echo $$i "writeable, not removed"; \
  141.           fi; \
  142.        done; \
  143.     else echo "Running \"make clobber\" as root will zap ALL SRCS,\
  144.         RCS'ed or not (not done)."; \
  145.     fi
  146.  
  147. compress:
  148.     make clean
  149.     @echo "Compressing source and RCS files."
  150.     find . -size +2 \( -name \*.h -o -name \*.c -o -name \*.f \
  151.         -o -name \*.p -o -name \*.l -o -name \*.y -o -name \*,v \) \
  152.         -exec compress {} \;
  153.  
  154. uncompress:
  155.     uncompressdir .
  156.  
  157. # RCS stuff
  158.  
  159. ci:        ${HDRS} ${SRCS}
  160.         -ci $?
  161.         @touch ci
  162.  
  163. coall:
  164.         co -l ${HDRS} ${SRCS}
  165.  
  166. update:
  167.         ci -sDist -u -f${VERS} ${HDRS} ${SRCS}
  168.         @touch ci
  169.  
  170. depend:
  171.     grep '^#[     ]*include' /dev/null ${SRCS} \
  172.         | sed -e '/"/s/:[^"]*"\([^"]*\)".*/: \1/' \
  173.               -e '/</s/:[^<]*<\([^>]*\)>.*/: \/usr\/include\/\1/' \
  174.         | sed -e 's/\.c:/.o:/' -e 's/\.p:/.o:/' \
  175.             -e 's/\.y:/.o:/' -e 's/\.l:/.o:/' >makedep
  176.     echo '/^# DO NOT DELETE THIS LINE/+2,$$d' >eddep
  177.     echo '$$r makedep' >>eddep
  178.     echo 'w' >>eddep
  179.     cp Makefile Makefile.bak
  180.     ed - Makefile < eddep
  181.     rm eddep makedep
  182.     echo '# DEPENDENCIES MUST END AT END OF FILE' >> Makefile
  183.     echo '# IF YOU PUT STUFF HERE IT WILL GO AWAY' >> Makefile
  184.     echo '# see make depend above' >> Makefile
  185.  
  186. # DO NOT DELETE THIS LINE -- make depend uses it
  187.  
  188. good.o: robots.h
  189. main.o: robots.h
  190. main.o: /usr/include/sys/stat.h
  191. opt.o: robots.h
  192. robot.o: robots.h
  193. score.o: robots.h
  194. user.o: robots.h
  195. # DEPENDENCIES MUST END AT END OF FILE
  196. # IF YOU PUT STUFF HERE IT WILL GO AWAY
  197. # see make depend above
  198.